home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / thesource6.dms / thesource6.adf / Source / Misc / DblBuffer.lha / dbl_buf.c
Encoding:
C/C++ Source or Header  |  1993-06-05  |  3.0 KB  |  71 lines

  1. Path: usenet.ee.pdx.edu!fastrac.llnl.gov!wsrcc.com!hack.dragoman.com!wetware!sgiblab!swrinde!cs.utexas.edu!math.ohio-state.edu!howland.reston.ans.net!newsserver.jvnc.net!rutgers!cbmvax!chrisg
  2. From: chrisg@cbmvax.cbm.commodore.com (Chris Green)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: hardware banging != bad code or AmigaDOS is bad code CRAP.
  5. Message-ID: <C83H4y.I2n@cbmvax.cbm.commodore.com>
  6. Date: 4 Jun 93 11:26:57 GMT
  7. References: <Jesse_Michael.040j@matrix.rain.com>
  8. Reply-To: chrisg@cbmvax.cbm.commodore.com (Chris Green)
  9. Organization: Commodore, West Chester, PA
  10. Lines: 58
  11.  
  12. In article <Jesse_Michael.040j@matrix.rain.com> Jesse_Michael@matrix.rain.com (Jesse Michael) writes:
  13. >In a message dated Wed  2 Jun 93 14:06, jmccoull@bruny.cc.utas.edu.au
  14. >(James McCoull) wrote:
  15. >
  16. >>Sure... but you can still get around this.  ScrollVPort is running from
  17. >>rom, so most data/instruction transfers will be on the fastram databus.
  18. >>Thus the trick goes something like this...  Still under 1.3 on my A1000
  19. >>I think ScrollVPort takes about 78-80 raster lines [during 4 bitplane
  20. >>video dma, no overscan].
  21. >
  22. >78 to 80 raster lines is 29.8% to 30.5% of the cpu time.  My test routine
  23. >took a little more than half a raster line to switch 8 bitplanes and update
  24. >the copper list when running on a 2 bitplane hi-res screen w/ no overscan.
  25.  
  26.     A simple timing test of ChangeVPBitMap on a standard no-fast-ram
  27. A1200 shows that this call can page-flip 4285 times per second. Note that
  28. this code is in C (and even calling ChangeVPBitMap via stack arguments
  29. and stubs), and is not even doing the trick of turning off intermediate
  30. copperlist update.
  31.     This is with an 8 bitplane intuition screen.
  32.     source (compiler warnings and all) follows. It's not really worth
  33. copiling and running unless you want to verify the timings, since it
  34. doesn't do anything even slightly cool while running.
  35.     I've already posted timings of ScrollVPort for 8 bitplane lores
  36. screens under 3.0 on A1200s.
  37.  
  38. #include <exec/types.h>
  39. #include <graphics/gfx.h>
  40. #include <intuition/intuition.h>
  41. #include <intuition/screens.h>
  42.  
  43. main()
  44. {
  45.     struct Screen *myscreen;
  46.     struct DBufInfo *mydbi;
  47.     void *temp;
  48.     int i;
  49.     ULONG secs,micros,oldsecs;
  50.     myscreen=OpenScreenTags(0,SA_DisplayID,0,SA_Depth,8,0);
  51.     mydbi=AllocDBufInfo(&(myscreen->ViewPort));
  52.     CurrentTime(&oldsecs,µs);
  53.     for(i=0;i<60000;i++)
  54.     {
  55.         ChangeVPBitMap(&(myscreen->ViewPort),myscreen->RastPort.BitMap,mydbi);
  56.     }
  57.     CurrentTime(&secs,µs);
  58.     printf("#secs=%d\n",secs-oldsecs);
  59.     FreeDBufInfo(mydbi);
  60.     CloseScreen(myscreen);
  61. }
  62. -- 
  63. *-------------------------------------------*---------------------------*
  64. |Chris Green - Graphics Software Engineer   - chrisg@commodore.COM      f
  65. |                  Commodore-Amiga          - rutgers!cbmvax!chrisg     n
  66. |My opinions are my own, and do not         - icantforgettheimpression  o
  67. |necessarily represent those of my employer.- youmadeyouleftaholeinthe  r
  68. |"A screaming comes across the sky..."      - backofmyhead              d
  69. *-------------------------------------------*---------------------------*
  70.  
  71.